package com.yungu.swift.schedule;

import com.yungu.swift.schedule.config.QuartzManager;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.ImportResource;
import org.springframework.kafka.annotation.EnableKafka;

/**
 * @Description:
 * @author: cuixiuyin
 * @date: 2018/12/19 21:32
 */
@SpringBootApplication
@EnableConfigurationProperties
@ImportResource(value = {"classpath:dubbo-consumer.xml"})
@EnableKafka
public class Application implements DisposableBean {

    @Autowired
    private QuartzManager quartzManager;

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        System.out.println("Application3启动成功");
    }


    @Override
    public void destroy() throws Exception {
        quartzManager.shutdownAllJob();
    }
}
